package com.ruoyi.merchant.service.impl;

import com.ruoyi.basedata.domain.WalletKind;
import com.ruoyi.basedata.mapper.WalletKindMapper;
import com.ruoyi.channel.domain.ChannelWallet;
import com.ruoyi.channel.domain.MpChannel;
import com.ruoyi.channel.mapper.ChannelWalletMapper;
import com.ruoyi.channel.mapper.MpChannelMapper;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.merchant.domain.*;
import com.ruoyi.merchant.mapper.MpMerchantMapper;
import com.ruoyi.merchant.mapper.MpMerchantWalletMapper;
import com.ruoyi.merchant.service.IMpMerchantWalletService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

/**
 *  服务层实现
 * 
 * @author ruoyi
 * @date 2019-05-06
 */
@Service
public class MpMerchantWalletServiceImpl implements IMpMerchantWalletService 
{
	Logger log = LoggerFactory.getLogger(MpMerchantWalletServiceImpl.class);
	@Autowired
	private MpMerchantWalletMapper mpMerchantWalletMapper;
	@Autowired
	private MpMerchantMapper merchantMapper;
	@Autowired
	private WalletKindMapper walletKindMapper;
	@Autowired
	private MpMerchantWalletMapper merchantWalletMapper;
	@Autowired
	private ChannelWalletMapper channelWalletMapper;
	@Autowired
	private MpChannelMapper channelMapper;

	/**
     * 查询信息
     * 
     * @param id ID
     * @return 信息
     */
    @Override
	public MpMerchantWallet selectMpMerchantWalletById(Integer id)
	{
	    return mpMerchantWalletMapper.selectMpMerchantWalletById(id);
	}
	
	/**
     * 查询列表
     * 
     * @param mpMerchantWallet 信息
     * @return 集合
     */
	@Override
	public List<MpMerchantWalletVo> selectMpMerchantWalletList(MpMerchantWallet mpMerchantWallet)
	{
	    return mpMerchantWalletMapper.selectMpMerchantWalletList(mpMerchantWallet);
	}
	
    /**
     * 新增
     * 
     * @param mpMerchantWallet 信息
     * @return 结果
     */
	@Override
	public int insertMpMerchantWallet(MpMerchantWallet mpMerchantWallet)
	{
	    return mpMerchantWalletMapper.insertMpMerchantWallet(mpMerchantWallet);
	}
	
	/**
     * 修改
     * 
     * @param mpMerchantWallet 信息
     * @return 结果
     */
	@Override
	public int updateMpMerchantWallet(MpMerchantWallet mpMerchantWallet)
	{
	    return mpMerchantWalletMapper.updateMpMerchantWallet(mpMerchantWallet);
	}

	/**
     * 删除对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteMpMerchantWalletByIds(String ids)
	{
		return mpMerchantWalletMapper.deleteMpMerchantWalletByIds(Convert.toStrArray(ids));
	}

	@Override
	public MpMerchantWallet checkMerchantWallet(MpMerchantWallet mpMerchantWallet) {
		return mpMerchantWalletMapper.checkMerchantWallet(mpMerchantWallet);
	}


	/**
	 * 查询渠道钱包
	 *
	 * @param status 状态
	 * @return 渠道钱包相关信息集合
	 */
	@Override
	public List<MerchantWithdrawal> channelWalletList(int status) {
		return mpMerchantWalletMapper.channelWalletList(status);
	}


	@Override
	public MpMerchantWalletVo selectMpMerchantWalletVoById(Integer id) {
		return mpMerchantWalletMapper.selectMpMerchantWalletVoById(id);
	}
}
